Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-crypto/raw-aes-keyring-node

Package Overview
Dependencies
Maintainers
9
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/raw-aes-keyring-node

The AWS Encryption SDK for JavaScript is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It uses a data format compatible with the AWS Encryption SDKs in other

  • 2.4.0
  • npm
  • Socket score

Version published
Weekly downloads
148K
decreased by-17.75%
Maintainers
9
Weekly downloads
 
Created

What is @aws-crypto/raw-aes-keyring-node?

@aws-crypto/raw-aes-keyring-node is an npm package provided by AWS that allows you to use raw AES keyrings for client-side encryption and decryption in Node.js applications. It is part of the AWS Encryption SDK, which provides tools for encrypting and decrypting data securely.

What are @aws-crypto/raw-aes-keyring-node's main functionalities?

Encrypting Data

This code sample demonstrates how to use the @aws-crypto/raw-aes-keyring-node package to encrypt data. It creates a RawAesKeyringNode with a specified key and uses it to encrypt a plaintext message.

const { RawAesKeyringNode, encrypt } = require('@aws-crypto/client-node');
const { KeyringNode } = require('@aws-crypto/raw-aes-keyring-node');

const keyName = 'example-key';
const keyNamespace = 'example-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff', 'hex');

const keyring = new RawAesKeyringNode({
  keyName,
  keyNamespace,
  unencryptedMasterKey
});

const plaintext = Buffer.from('Hello, world!');

(async () => {
  const { result } = await encrypt(keyring, plaintext);
  console.log(result); // Encrypted data
})();

Decrypting Data

This code sample demonstrates how to use the @aws-crypto/raw-aes-keyring-node package to decrypt data. It creates a RawAesKeyringNode with a specified key and uses it to decrypt an encrypted message.

const { RawAesKeyringNode, decrypt } = require('@aws-crypto/client-node');
const { KeyringNode } = require('@aws-crypto/raw-aes-keyring-node');

const keyName = 'example-key';
const keyNamespace = 'example-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff', 'hex');

const keyring = new RawAesKeyringNode({
  keyName,
  keyNamespace,
  unencryptedMasterKey
});

const encryptedData = Buffer.from('...'); // Replace with your encrypted data

(async () => {
  const { plaintext } = await decrypt(keyring, encryptedData);
  console.log(plaintext.toString()); // Decrypted data
})();

Other packages similar to @aws-crypto/raw-aes-keyring-node

FAQs

Package last updated on 13 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc